package com.heima.utils;


public class BizResult {

    // 返回状态
    private int status;
    // 状态描述
    private String desc;
    // 返回数据
    private Object data;

    private String token;

    private int code;

    public static BizResult ok(String message) {
        BizResult bizResult = new BizResult();
        bizResult.setStatus(200);
        bizResult.setCode(1);
        return bizResult;
    }

    public static BizResult fail(String message) {
        BizResult bizResult = new BizResult();
        bizResult.setStatus(500);
        bizResult.setCode(0);
        bizResult.setDesc("返回失败");
        return bizResult;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
}
